package com.itheima.stock.mapper;

import com.itheima.stock.common.domain.InnerMarketDomain;
import com.itheima.stock.pojo.StockMarketIndexInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @author WanWangLei
* @description 针对表【stock_market_index_info(股票大盘数据详情表)】的数据库操作Mapper
* @createDate 2022-01-08 19:37:46
* @Entity com.itheima.stock.pojo.StockMarketIndexInfo
*/
@Mapper
public interface StockMarketIndexInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockMarketIndexInfo record);

    int insertSelective(StockMarketIndexInfo record);

    StockMarketIndexInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockMarketIndexInfo record);

    int updateByPrimaryKey(StockMarketIndexInfo record);

    List<InnerMarketDomain> selectByIdAndDate(@Param("innerIds") List<String> innerIds, @Param("lastDate") String lastDate);


    /**
     * 查询指定大盘下的指定日期下小于等于指定时间的数据，结果包含：每分钟内，整体大盘的交易量的统计
     * @param marketIds 股票大盘的编码code集合
     * @param tStr 日期时间，精确到秒
     * @return
     */
    List<Map> getStockTravol(@Param("marketIds") List<String> marketIds, @Param("stockDateTime") String tStr);
    /**
     * 批量插入大盘数据
     * @param list 大盘实体对象集合
     * @return
     */
    int insertBatch(@Param("list") ArrayList<StockMarketIndexInfo> list);

}
